FinishGridCtl = Ext.extend(GridCtl, {

			getCmItems : function() {

				var items = [
						this.getCmItem('任务编号', 'id', true),
						this.getCmItem('状态', 'status', true),
						this.getCmItem('任务类型', 'type', true),
						this.getCmItem('创建人id', 'createuser', false),
						this.getCmItem('创建人', 'createusername', true),
						this.getCmItem('创建时间', 'createtime', true),
						this.getCmItem('审核人id', 'verifyuserid', false),
						this.getCmItem('审核人', 'verifyuser', true),
						this.getCmItem('审核时间', 'verifytime', true),
						this.getCmItem('经理id', 'pmgrid', false),
						this.getCmItem('经理名称', 'pmgrname', true),
						this.getCmItem('开始时间', 'workstarttime', true),
						this.getCmItem('完成时间', 'workfinishtime',
										true),
						this.getCmItem('确认完成人id', 'pastid', false),
						this.getCmItem('确认完成人', 'pastname', true),
						this.getCmItem('确认完成时间', 'pasttime', true),
						this.getCmItem('部门id', 'departmentid', false),
						this.getCmItem('部门', 'depname', true),
						this.getCmItem('协议单编号', 'contractid', true),
						this.getCmItem('根协议单编号', 'rootid', true)

				];

				return items;
			},

			getCommonConfig : function() {

				var config = {
					region : 'south'
				};

				return config;

			},
			configButtons : function(config) {
				
//				finishmgr_read
//				finishmgr_showdetail
//				finishmgr_audit

				var buttons = [{
							text : '审核通过',
							handler : this.pass,
							scope : this
						}, {
							text : '审核不通过',
							handler : this.unpass,
							scope : this
						}, {
							text : '详细信息',
							handler : this.showDetail,
							scope : this
						}];

				config.buttonAlign = 'left';
				config.buttons = buttons;

				return config;

			},
			getStoreUrl : function() {

				var resource = 'task.do';
				var server = cf.getC('s');
				var url = server.getUrl({
							resource : resource,
							act : 'taskfinish'
						});
				return url;
			},
			load : function() {

				var store = this.store;

				store.baseParams = {
					status : -1
				};
				store.load();

			},
			pass : function() {

				var records = this.getSelectList();
				if(records.length == 0){
					alert('请首先选择一条记录！');
					return;
				}
				var idList = [];
				for (var i = 0; i < records.length; i++) {
					idList.push({
								id : records[i].get('id'),
								status : 1
							});
				}

				this.updateStatus(idList);

			},
			unpass : function() {

				var records = this.getSelectList();
				if(records.length == 0){
					alert('请首先选择一条记录！');
					return;
				}

				var idList = [];
				for (var i = 0; i < records.length; i++) {
					idList.push({
								id : records[i].get('id'),
								status : 2
							});
				}

				this.updateStatus(idList);

			},
			updateStatus : function(recordList) {

				var s = cf.getC('s');

				s.request({
							resource : 'task.do',
							act : 'updateFinishStatus',
							params : {
								itemlist : Ext.encode(recordList)
							},
							scope : this,
							cbf : this.updateCbf
						});

			},
			updateCbf : function() {
				this.reload();
			},
			showDetail : function() {

				var record = this.getSelectedRecord();
				if (!record) {
					alert('请先选择一条记录！');
					return;
				}

				var oswc = cf.getC('oswc');
				oswc.show(record.get('id'));
			}

		});
